<#include "/common/head.html"/>
<div class="easyui-panel updatePage" data-options="fit:true,border:false">
	<form id="ff" class="easyui-form" method="post">
		<table class="table1">
			<tr>
				<th><span id="name_label">模板名称：</span></th>
				<td>
					<div class="wrap_input">
						<input class="easyui-textbox" type="text" name="template_name" id="template_name"
							value="${model.template_name!''}" data-options="fit: true,required:true"></input>
					</div>
				</td>
			</tr>
			<tr>
				<th><span id="target_type_label">所属分类：</span></th>
				<td>
					<div class="wrap_input">
						<input class="easyui-combobox" id="classify_value" name="classify_value" value="${model.classify_value!''}"
							data-options="valueField: 'id',textField: 'text',fit: true,
							data: [
	            				{id:'', text:''}<#list classify.keySet() as key>,{id:'${key}', text:'${classify.get(key)}'}</#list>
	            			],required:true" />
					</div>
				</td>
			</tr>
		</table>
	</form>
</div>
<script>
top.window.subPage.save = save;
function save() {
	if($("#zcurdHeadTable").form('validate')) {
		$.post("update", getParam(), function(data) {
			top.window.closeWindow();
			top.window.subPage.loadCurrDatagrid();
		});
	}
}
function getParam() {
	var param = {
	    "id": ${model.id}, 
	    "model.template_name" : getInputValue("template_name"),
		"model.classify_value" : getInputValue("classify_value")
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}

//扩展js
</script>
<#include "/common/foot.html"/>
